//dp  
#pragma once

typedef struct{
    int groupId;    //分组id （通过slaveId fc_code 得到）
    int slaveId;
    int fc_code;
    int regStart;
    int regCount;
    int regValue;
    char regName[128];
    int isMapped; //是否已经进行映射，0：没有，1：已经映射
}dp_param_t;

enum{
    ECH_TYPE_NULL=0,
    ECH_TYPE_LOCAL=1,
    ECH_TYPE_MODBUS_RTU=2,
    ECH_TYPE_MODBUS_TCP=3,
    ECH_TYPE_MODBUS_RTU_OVER_TCP=4
};

enum E_WORK_STATE{
    ECH_MB_RTU_WORK_STATE_NULL,
    ECH_MB_RTU_WORK_STATE_NORMAL,
    ECH_MB_RTU_WORK_STATE_PJMODE,

    ECH_MB_TCP_WORK_STATE_CONNECTING,
    ECH_MB_RTU_WORK_STATE_CONNECTFAIL
};


#define DP_SUCCESS 0
#define DP_ERROR    -1